package com.coded2.mobileposto.model;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;


/**
 * The persistent class for the consumo database table.
 * 
 */
@Entity
@NamedQuery(name="Consumo.findAll", query="SELECT c FROM Consumo c")
public class Consumo extends com.coded2.infra.comum.ComumDTO  {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="id_consumo")
	private String idConsumo;

	@Column(name="media_consumo")
	private BigDecimal mediaConsumo;

	//bi-directional many-to-one association to Usuario
	@ManyToOne
	@JoinColumn(name="id_usuario")
	private Usuario usuario;

	//bi-directional many-to-one association to Modelo
	@ManyToOne
	@JoinColumn(name="id_modelo")
	private Modelo modelo;

	public Consumo() {
	}

	public String getIdConsumo() {
		return this.idConsumo;
	}

	public void setIdConsumo(String idConsumo) {
		this.idConsumo = idConsumo;
	}

	public BigDecimal getMediaConsumo() {
		return this.mediaConsumo;
	}

	public void setMediaConsumo(BigDecimal mediaConsumo) {
		this.mediaConsumo = mediaConsumo;
	}

	public Usuario getUsuario() {
		return this.usuario;
	}

	public void setUsuario(Usuario usuario) {
		this.usuario = usuario;
	}

	public Modelo getModelo() {
		return this.modelo;
	}

	public void setModelo(Modelo modelo) {
		this.modelo = modelo;
	}

	@Override
	public Object getId() {
		return getIdConsumo();
	}

}